Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve parameter types only when checkArgumentTypes=true #2106

Merged
merged 1 commit into from Dec 13, 2022

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Dec 13, 2022

No description provided.

))->line($argumentLine)->build();
}
if ($this->checkArgumentTypes) {
$parameterType = TypeUtils::resolveLateResolvableTypes($parameter->getType());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer this resolving until we realy need the value


if ($this->checkUnresolvableParameterTypes
&& $originalParameter !== null
&& isset($messages[13])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the cheap isset($messages[13]) condition before the 2 resolving calls

@staabm staabm marked this pull request as ready for review December 13, 2022 20:11
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit e74be98 into phpstan:1.9.x Dec 13, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the less-greedy branch December 13, 2022 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants